import { getRequest, postRequest, deleteRequest } from './request'

const HttpManager = {
  LoginApi: (params) => postRequest(`users/login`, params),
  users_statebefore: (params) => postRequest(`users/statebefore`,params),
  users_statecer: (params) => postRequest(`users/statecer`,params),
  users_signup: (params) => postRequest(`users/insert`,params),
  certification_insert:(params) => postRequest("certification/insert", params, 2),
  publicroom_insert:(params) => postRequest("publicroom/insert", params),
  publicroom_serchbypid:(params) => postRequest("publicroom/serchbypid", params),
  publicapply_insert:(params) => postRequest("publicapply/insert", params),
  // 获取认证信息
  getCertificate: (params) => getRequest(`users/certificatestatus/${params}`),
  // 获取住房列表
  getBuildingList: () => getRequest("/building/all"),
  // 申请住房
  applyBuilding: (params) => postRequest("buildingapply/insert", params),
  // 查看申请住房状态
  getApplyBuildingStatus: (params) => getRequest(`/buildingapply/checkstatus/${params}`),
  //查看当前住房
  getBuilddingByUid :(params) => getRequest(`/building/searchbyuid/${params}`),
  //退房申请
  buildingwithdraw_insert: (params) =>postRequest("/buildingwithdraw/insert",params),
  //更新退房信息
  buildingwithdraw_update: (params) =>postRequest("/buildingwithdraw/update",params),
  //所有公共空间
  allUserPublicRoom: () => getRequest("/publicroom/user/all"),
  //访客申请
  visitor_insert: (params) =>postRequest("/visitor/insert",params),
  //更新访客申请
  visitor_update: (params) =>postRequest("/visitor/update",params),
  //查找访客
  getVisitorByUid: (params) => getRequest(`/visitor/searchbyuid/${params}`),
  //用户设施维修申请
  repair_insert: (params) => postRequest("/repair/userapply",params,2),
  //查找用户设施维修申请
  getRepairByUid: (params) => getRequest(`/repair/searchbyuid/${params}`),
  //用户设施维修修改
  repair_update: (params) => postRequest("/repair/userapplyupdate",params,2),
  //用户公共空间申请
  publicRoom_apply: (params) => postRequest("/publicapply/userapply",params),
  // 请求合同信息
  getSignInfo: (params) => getRequest(`/buildingapply/getSignInfo/${params.uid}/${params.bid}`),
  // =======================> 用户 API
  // 返回所有用户
  //getAllUser: () => getRequest(`user`),
  // 返回指定ID的用户
  //getUserOfId: (id) => getRequest(`user/detail?id=${id}`),

}

export { HttpManager };
